package com.cacho.s2b.lesson.object;

/** Description: 抽象类的子类
 * 1.继承抽象方法的子类必须重写该方法。否则，该子类也必须声明为抽象类。
 **/
public class AbstractChild extends AbstractClass{
    public AbstractChild(String name, String explain) {
        super(name, explain);
    }
    public String toString(){
        System.out.println("子类重写方法："+getName() + getExplain());
        return getName() + getExplain();
    }
    public static void main(String [] args){
        // 'AbstractClass' is abstract; cannot be instantiated 报错
        AbstractChild ab = new AbstractChild("abstract", "explain");
        ab.toString();
    }
}
